// BaseGameEntity.cpp : 
//

#include "BaseGameEntity.h"

int BaseGameEntity::s_iNextValidID = 0;

std::map<int, std::_tstring> BaseGameEntity::s_names;

void BaseGameEntity::SetID(int val)
{
	if (val >= s_iNextValidID)
	{
		m_ID = val;
		s_iNextValidID = val + 1;
	}
	else
		m_ID = s_iNextValidID++;
}


std::_tstring BaseGameEntity::GetNameOfEntity(int id)
{
	std::map<int, std::_tstring>::iterator iter = s_names.find(id);
	if (iter != s_names.end())
		return iter->second;
	else
		return _T("");
}

void BaseGameEntity::AddNameOfEntity(int id, std::_tstring name)
{
	s_names.insert(std::map<int, std::_tstring>::value_type(id, name));
}